]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screencastService: Add gstreamer pipeline for h264 encoding on hardware
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 22 Jan 2023 18:29:23 +0000 (19:29 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 9 Jul 2024 17:46:07 +0000 (17:46 +0000)
Try h264 on intel and AMD hardware using VA-API, using vapostproc
to do the color conversion using specialized hardware. We're not adding
a vaapi pipeline using the color conversion GL shader here, as vapostproc
color conversion should be better suited for anything needed by vaapi
based encoders/decoders.

A capsfilter is used to enforce the use of DMAbuf (memory:DMABuf) with
the new explicit modifier API (format=DMA_DRM).

Also, we're using the new va* gst elements instead of the vaapi* ones
here, as the vaapi* elements are deprecated, while the va* elements are
actively maintained.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2080>

js/dbusServices/screencast/screencastService.js

index 0645811fa0ae82d56d1eea23f4919312ff6fc6cd..c01aa830fc0d354f7250964179c95e07ea5f3337 100644 (file)
@@ -31,6 +31,17 @@ const DEFAULT_DRAW_CURSOR = true;
 const PIPELINE_BLOCKLIST_FILENAME = 'gnome-shell-screencast-pipeline-blocklist';
 
 const PIPELINES = [
+    {
+        id: 'hwenc-dmabuf-h264-vaapi',
+        fileExtension: 'mp4',
+        pipelineString:
+            'capsfilter caps=video/x-raw(memory:DMABuf),format=DMA_DRM,max-framerate=%F/1 ! \
+             vapostproc ! \
+             vah264enc ! \
+             queue ! \
+             h264parse ! \
+             mp4mux fragment-duration=500 fragment-mode=first-moov-then-finalise',
+    },
     {
         id: 'swenc-dmabuf-h264-openh264',
         fileExtension: 'mp4',